package agenda;

import java.awt.FlowLayout;

import javax.swing.*; 

public class FormUsuario {
	private JLabel labelNome;
	private JTextField textFieldNome;
	
	private JLabel labelEmail;
	private JTextField textFieldEmail;
	
	private JLabel labelComentario;
	private JTextArea textAreaComentario;
	
	private JButton botaoOk;
	private JButton botaoCancela;
	
	private JPanel panel;
	private JFrame frame;
	
	private void montarFormularioUsuario() {
		labelNome = new JLabel("Nome:");
		textFieldNome = new JTextField(20);
		
		labelEmail = new JLabel("Email:");
		textFieldEmail = new JTextField(20);
		
		labelComentario = new JLabel("Comentario:");
		textAreaComentario = new JTextArea(10,20);
		
        botaoOk = new JButton("OK");
        botaoCancela = new JButton("Cancelar");
		
		//Inicia o painel da janela
		panel = new JPanel();
		panel.add(labelNome);
		panel.add(textFieldNome);
		panel.add(labelEmail);
		panel.add(textFieldEmail);
		panel.add(labelComentario);
		panel.add(textAreaComentario);
		panel.add(botaoOk);
		panel.add(botaoCancela);
		
		panel.setLayout(new FlowLayout(FlowLayout.LEFT));
		
		//Inicia a janela
		frame = new JFrame("Dados do Usuario");

		frame.add(panel);
		frame.pack();
		frame.setSize(250, 355);
		frame.setResizable(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
	
	public static void main(String[] args) {
		new FormUsuario().montarFormularioUsuario();
	}
}